﻿using Microsoft.ApplicationBlocks.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DevExpressWebApplication1.Utils
{
    public class ProductUtils
    {
        public static Boolean Insert(string product_name,string code,string buy_price, string sell_price, string Description, string category_id)
        {
            int id = SqlHelper.ExecuteNonQuery(DataServices.ConnectString, "sp_Product_Insert", product_name, code, buy_price, sell_price, Description, category_id);
            bool isSuccess = false;
            if (id > 0)
                isSuccess = true;
            return isSuccess;
        }

        public static Boolean Update(int product_id, string product_name,string code,string buy_price, string sell_price, string Description, string category_id)
        {
            int id = SqlHelper.ExecuteNonQuery(DataServices.ConnectString, "sp_Product_Update",product_id, product_name, code, buy_price, sell_price, Description, category_id);
            bool isSuccess = false;
            if (id > 0)
                isSuccess = true;
            return isSuccess;
        }
    }
}